<style>
</style>

<template>
    <div class="table">
        <Table border :columns="columns" :data="list"></Table>
        <Page :current.sync="page" :total="total_count" :page-size="limit" @on-change="getList" show-total show-elevator :style="{'text-align': 'center'}"></Page>
    </div>
</template>
<script>
import http from '../../libs/http';
export default {
    data () {
        return {
            list: [],
            total_count: 0,
            page: 1,
            limit: 15,
            keywords: '',
            columns: [
                /* {
                    title: 'ID',
                    key: 'id',
                    align: 'center'
                }, */
                {
                    title: '昵称',
                    key: 'nickname',
                    align: 'center'
                },
                {
                    title: '性别',
                    key: 'gender',
                    align: 'center'
                },
                {
                    title: '手机',
                    key: 'mobile',
                    align: 'center'
                },
                {
                    title: '当前学分',
                    key: 'points',
                    align: 'center'
                },
                {
                    title: '绑定机构',
                    key: 'organization',
                    align: 'center'
                },
                {
                    title: '最后登录时间',
                    key: 'last_login_time',
                    align: 'center'
                },
                /* {
                    title: '真实姓名',
                    key: 'realname',
                    align: 'center'
                },
                {
                    title: '身份证',
                    key: 'id_card',
                    align: 'center'
                }, */
                {
                    title: '操作',
                    key: 'action',
                    align: 'center',
                    render: (h, param) => {
                        return h('div', [
                            h('Button',{
                                props: {
                                    type: 'primary',
                                    size: 'small'
                                },
                                style: {
                                    marginRight: '10px'
                                },
                                on: {
                                    click: () => {
                                        this.edit(params.index)
                                    }
                                }
                            }, '查看详情'),
                        ])
                    }
                }
            ]
        }
    },
    methods: {
        getList (page) {   //获取成员列表
            this.page = page;
            var that = this;
            var url = 'admin/app/user/index/page/' + page + '/limit/' + this.limit;
            this.apiGet(url).then((res) => {
                if (res.code != 200) {
                    this.handleError(res);
                } else {
                    that.list = res.data.list;
                    that.total_count = res.data.total_count;
                }
            })
        },
    },
    created () {
        this.getList(this.page);
    },
    mixins: [http]
}
</script>
